<template>
  <div style="margin-top: 1rem">
    <van-field v-model="value" maxlength="300" style="height: 8rem" placeholder="编辑常用语内容" type="textarea"/>
    <div class="btn-box">
      <div class="weui-btn weui-btn_primary" :class="value?'':'weui-btn_disabled'" @click="save">保存</div>
    </div>
  </div>
</template>
<script>
  export default {
    data() {
      return {
        value: ''
      }
    },
    methods: {
      save() {
        this.$router.push({name:'phraseEdit',params: {data:this.value}})
      }
    }
  }
</script>
<style lang="stylus">
.btn-box
  box-sizing: border-box
  width: 100%
  .weui-btn
    border-radius: 20px
    border: none
    width: 90%
    height: 37px
    text-align: center
    line-height: 37px
    margin: 20px auto 0
    color: #fff
    &.weui-btn_primary
      border: none
      background: #108ee9
    &.weui-btn_disabled
      border: none
      background: #c3e3f9
</style>